<template>
  <!-- 我的 -->
  <view>
    <!--招聘端 -->
    <recruitMine v-if="userType === '1'" ref="recruitMine"></recruitMine>
    <!--企业端 -->
    <enterpriseMine v-else ref="enterpriseMine" @update="update"></enterpriseMine>
  </view>
</template>

<script>
// import http from "../../utils/http";
import recruitMine from "../../recruit/mine/index.vue";
import enterpriseMine from "@/components/enterprise/mine.vue";
import { mapState } from "vuex";
// import { getToken } from "@/utils/auth";
export default {
  components: {
    recruitMine,
    enterpriseMine,
  },
  data() {
    return {
      styleData: {
        topText: "",
        background: "#2eabee",
        TextColor: "#FFF",
      },
    };
  },
  computed: {
    ...mapState(["userType"]),
  },
  watch: {
    // userType(v) {
    //   console.log(v, "---------v");
    //   if (v === 2) {
    //     this.$refs.enterpriseMine.getUserInfoAPI();
    //   }
    // },
    // immediate: true,
    // deep: true,
  },
  async onLoad(options) { },

  onShow() {
    if (this.userType === "2") {
      this.$refs.enterpriseMine.getUserInfoAPI();
      // this.$refs.enterpriseMine.getLoginStatus();
    }
    if (this.userType === "1") {
      this.$refs.recruitMine.getWXuserInfoFun();
      this.$refs.recruitMine.getCodeInfoFun();
    }
  },
  mounted() { },
  onReady() { },
  methods: {},
  onShareAppMessage(res) {
    console.log(res);
  },
};
</script>
<style lang="scss" scoped>
.home-app {
  position: relative;
  height: 100%;
}
</style>
